package io.kiki.sba.registry.common.model.client.pb;

/**
 * Protobuf type {@code DataBoxesPb}
 */
public final class DataBoxesPb extends com.google.protobuf.GeneratedMessageV3 implements
        // @@protoc_insertion_point(message_implements:DataBoxesPb)
        DataBoxesPbOrBuilder {
    public static final int DATA_FIELD_NUMBER = 1;
    private static final long serialVersionUID = 1L;
    // @@protoc_insertion_point(class_scope:DataBoxesPb)
    private static final DataBoxesPb DEFAULT_INSTANCE;
    private static final com.google.protobuf.Parser<DataBoxesPb> PARSER = new com.google.protobuf.AbstractParser<DataBoxesPb>() {
        public DataBoxesPb parsePartialFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException {
            return new DataBoxesPb(input, extensionRegistry);
        }
    };

    static {
        DEFAULT_INSTANCE = new DataBoxesPb();
    }

    private java.util.List<DataBoxPb> data_;
    private byte memoizedIsInitialized = -1;

    // Use DataBoxesPb.newBuilder() to construct.
    private DataBoxesPb(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
        super(builder);
    }

    private DataBoxesPb() {
        data_ = java.util.Collections.emptyList();
    }

    private DataBoxesPb(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException {
        this();
        if (extensionRegistry == null) {
            throw new java.lang.NullPointerException();
        }
        int mutable_bitField0_ = 0;
        com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder();
        try {
            boolean done = false;
            while (!done) {
                int tag = input.readTag();
                switch (tag) {
                case 0:
                    done = true;
                    break;
                default: {
                    if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) {
                        done = true;
                    }
                    break;
                }
                case 10: {
                    if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
                        data_ = new java.util.ArrayList<DataBoxPb>();
                        mutable_bitField0_ |= 0x00000001;
                    }
                    data_.add(input.readMessage(DataBoxPb.parser(), extensionRegistry));
                    break;
                }
                }
            }
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(this);
        } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
        } finally {
            if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
                data_ = java.util.Collections.unmodifiableList(data_);
            }
            this.unknownFields = unknownFields.build();
            makeExtensionsImmutable();
        }
    }

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return DataBoxesPbOuterClass.internal_static_DataBoxesPb_descriptor;
    }

    public static DataBoxesPb parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
    }

    public static DataBoxesPb parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
    }

    public static DataBoxesPb parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
    }

    public static DataBoxesPb parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
    }

    public static DataBoxesPb parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
    }

    public static DataBoxesPb parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
    }

    public static DataBoxesPb parseFrom(java.io.InputStream input) throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static DataBoxesPb parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry);
    }

    public static DataBoxesPb parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static DataBoxesPb parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    }

    public static DataBoxesPb parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static DataBoxesPb parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry);
    }

    public static Builder newBuilder() {
        return DEFAULT_INSTANCE.toBuilder();
    }

    public static Builder newBuilder(DataBoxesPb prototype) {
        return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }

    public static DataBoxesPb getDefaultInstance() {
        return DEFAULT_INSTANCE;
    }

    public static com.google.protobuf.Parser<DataBoxesPb> parser() {
        return PARSER;
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        return this.unknownFields;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() {
        return DataBoxesPbOuterClass.internal_static_DataBoxesPb_fieldAccessorTable.ensureFieldAccessorsInitialized(DataBoxesPb.class, DataBoxesPb.Builder.class);
    }

    /**
     * <code>repeated .DataBoxPb data = 1;</code>
     */
    public java.util.List<DataBoxPb> getDataList() {
        return data_;
    }

    /**
     * <code>repeated .DataBoxPb data = 1;</code>
     */
    public java.util.List<? extends DataBoxPbOrBuilder> getDataOrBuilderList() {
        return data_;
    }

    /**
     * <code>repeated .DataBoxPb data = 1;</code>
     */
    public int getDataCount() {
        return data_.size();
    }

    /**
     * <code>repeated .DataBoxPb data = 1;</code>
     */
    public DataBoxPb getData(int index) {
        return data_.get(index);
    }

    /**
     * <code>repeated .DataBoxPb data = 1;</code>
     */
    public DataBoxPbOrBuilder getDataOrBuilder(int index) {
        return data_.get(index);
    }

    public final boolean isInitialized() {
        byte isInitialized = memoizedIsInitialized;
        if (isInitialized == 1)
            return true;
        if (isInitialized == 0)
            return false;

        memoizedIsInitialized = 1;
        return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
        for (int i = 0; i < data_.size(); i++) {
            output.writeMessage(1, data_.get(i));
        }
        unknownFields.writeTo(output);
    }

    public int getSerializedSize() {
        int size = memoizedSize;
        if (size != -1)
            return size;

        size = 0;
        for (int i = 0; i < data_.size(); i++) {
            size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, data_.get(i));
        }
        size += unknownFields.getSerializedSize();
        memoizedSize = size;
        return size;
    }

    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof DataBoxesPb)) {
            return super.equals(obj);
        }
        DataBoxesPb other = (DataBoxesPb) obj;

        boolean result = true;
        result = result && getDataList().equals(other.getDataList());
        result = result && unknownFields.equals(other.unknownFields);
        return result;
    }

    @java.lang.Override
    public int hashCode() {
        if (memoizedHashCode != 0) {
            return memoizedHashCode;
        }
        int hash = 41;
        hash = (19 * hash) + getDescriptor().hashCode();
        if (getDataCount() > 0) {
            hash = (37 * hash) + DATA_FIELD_NUMBER;
            hash = (53 * hash) + getDataList().hashCode();
        }
        hash = (29 * hash) + unknownFields.hashCode();
        memoizedHashCode = hash;
        return hash;
    }

    public Builder newBuilderForType() {
        return newBuilder();
    }

    public Builder toBuilder() {
        return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        Builder builder = new Builder(parent);
        return builder;
    }

    @java.lang.Override
    public com.google.protobuf.Parser<DataBoxesPb> getParserForType() {
        return PARSER;
    }

    public DataBoxesPb getDefaultInstanceForType() {
        return DEFAULT_INSTANCE;
    }

    /**
     * Protobuf type {@code DataBoxesPb}
     */
    public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
            // @@protoc_insertion_point(builder_implements:DataBoxesPb)
            DataBoxesPbOrBuilder {
        private int bitField0_;
        private java.util.List<DataBoxPb> data_ = java.util.Collections.emptyList();
        private com.google.protobuf.RepeatedFieldBuilderV3<DataBoxPb, DataBoxPb.Builder, DataBoxPbOrBuilder> dataBuilder_;

        // Construct using com.alipay.sofa.registry.common.model.client.pb.DataBoxesPb.newBuilder()
        private Builder() {
            maybeForceBuilderInitialization();
        }

        private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
            super(parent);
            maybeForceBuilderInitialization();
        }

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
            return DataBoxesPbOuterClass.internal_static_DataBoxesPb_descriptor;
        }

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() {
            return DataBoxesPbOuterClass.internal_static_DataBoxesPb_fieldAccessorTable.ensureFieldAccessorsInitialized(DataBoxesPb.class, DataBoxesPb.Builder.class);
        }

        private void maybeForceBuilderInitialization() {
            if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
                getDataFieldBuilder();
            }
        }

        public Builder clear() {
            super.clear();
            if (dataBuilder_ == null) {
                data_ = java.util.Collections.emptyList();
                bitField0_ = (bitField0_ & ~0x00000001);
            } else {
                dataBuilder_.clear();
            }
            return this;
        }

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
            return DataBoxesPbOuterClass.internal_static_DataBoxesPb_descriptor;
        }

        public DataBoxesPb getDefaultInstanceForType() {
            return DataBoxesPb.getDefaultInstance();
        }

        public DataBoxesPb build() {
            DataBoxesPb result = buildPartial();
            if (!result.isInitialized()) {
                throw newUninitializedMessageException(result);
            }
            return result;
        }

        public DataBoxesPb buildPartial() {
            DataBoxesPb result = new DataBoxesPb(this);
            int from_bitField0_ = bitField0_;
            if (dataBuilder_ == null) {
                if (((bitField0_ & 0x00000001) == 0x00000001)) {
                    data_ = java.util.Collections.unmodifiableList(data_);
                    bitField0_ = (bitField0_ & ~0x00000001);
                }
                result.data_ = data_;
            } else {
                result.data_ = dataBuilder_.build();
            }
            onBuilt();
            return result;
        }

        public Builder clone() {
            return (Builder) super.clone();
        }

        public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
            return (Builder) super.setField(field, value);
        }

        public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
            return (Builder) super.clearField(field);
        }

        public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
            return (Builder) super.clearOneof(oneof);
        }

        public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
            return (Builder) super.setRepeatedField(field, index, value);
        }

        public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
            return (Builder) super.addRepeatedField(field, value);
        }

        public Builder mergeFrom(com.google.protobuf.Message other) {
            if (other instanceof DataBoxesPb) {
                return mergeFrom((DataBoxesPb) other);
            } else {
                super.mergeFrom(other);
                return this;
            }
        }

        public Builder mergeFrom(DataBoxesPb other) {
            if (other == DataBoxesPb.getDefaultInstance())
                return this;
            if (dataBuilder_ == null) {
                if (!other.data_.isEmpty()) {
                    if (data_.isEmpty()) {
                        data_ = other.data_;
                        bitField0_ = (bitField0_ & ~0x00000001);
                    } else {
                        ensureDataIsMutable();
                        data_.addAll(other.data_);
                    }
                    onChanged();
                }
            } else {
                if (!other.data_.isEmpty()) {
                    if (dataBuilder_.isEmpty()) {
                        dataBuilder_.dispose();
                        dataBuilder_ = null;
                        data_ = other.data_;
                        bitField0_ = (bitField0_ & ~0x00000001);
                        dataBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getDataFieldBuilder() : null;
                    } else {
                        dataBuilder_.addAllMessages(other.data_);
                    }
                }
            }
            this.mergeUnknownFields(other.unknownFields);
            onChanged();
            return this;
        }

        public final boolean isInitialized() {
            return true;
        }

        public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException {
            DataBoxesPb parsedMessage = null;
            try {
                parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
            } catch (com.google.protobuf.InvalidProtocolBufferException e) {
                parsedMessage = (DataBoxesPb) e.getUnfinishedMessage();
                throw e.unwrapIOException();
            } finally {
                if (parsedMessage != null) {
                    mergeFrom(parsedMessage);
                }
            }
            return this;
        }

        private void ensureDataIsMutable() {
            if (!((bitField0_ & 0x00000001) == 0x00000001)) {
                data_ = new java.util.ArrayList<DataBoxPb>(data_);
                bitField0_ |= 0x00000001;
            }
        }

        /**
         * <code>repeated .DataBoxPb data = 1;</code>
         */
        public java.util.List<DataBoxPb> getDataList() {
            if (dataBuilder_ == null) {
                return java.util.Collections.unmodifiableList(data_);
            } else {
                return dataBuilder_.getMessageList();
            }
        }

        /**
         * <code>repeated .DataBoxPb data = 1;</code>
         */
        public int getDataCount() {
            if (dataBuilder_ == null) {
                return data_.size();
            } else {
                return dataBuilder_.getCount();
            }
        }

        /**
         * <code>repeated .DataBoxPb data = 1;</code>
         */
        public DataBoxPb getData(int index) {
            if (dataBuilder_ == null) {
                return data_.get(index);
            } else {
                return dataBuilder_.getMessage(index);
            }
        }

        /**
         * <code>repeated .DataBoxPb data = 1;</code>
         */
        public Builder setData(int index, DataBoxPb value) {
            if (dataBuilder_ == null) {
                if (value == null) {
                    throw new NullPointerException();
                }
                ensureDataIsMutable();
                data_.set(index, value);
                onChanged();
            } else {
                dataBuilder_.setMessage(index, value);
            }
            return this;
        }

        /**
         * <code>repeated .DataBoxPb data = 1;</code>
         */
        public Builder setData(int index, DataBoxPb.Builder builderForValue) {
            if (dataBuilder_ == null) {
                ensureDataIsMutable();
                data_.set(index, builderForValue.build());
                onChanged();
            } else {
                dataBuilder_.setMessage(index, builderForValue.build());
            }
            return this;
        }

        /**
         * <code>repeated .DataBoxPb data = 1;</code>
         */
        public Builder addData(DataBoxPb value) {
            if (dataBuilder_ == null) {
                if (value == null) {
                    throw new NullPointerException();
                }
                ensureDataIsMutable();
                data_.add(value);
                onChanged();
            } else {
                dataBuilder_.addMessage(value);
            }
            return this;
        }

        /**
         * <code>repeated .DataBoxPb data = 1;</code>
         */
        public Builder addData(int index, DataBoxPb value) {
            if (dataBuilder_ == null) {
                if (value == null) {
                    throw new NullPointerException();
                }
                ensureDataIsMutable();
                data_.add(index, value);
                onChanged();
            } else {
                dataBuilder_.addMessage(index, value);
            }
            return this;
        }

        /**
         * <code>repeated .DataBoxPb data = 1;</code>
         */
        public Builder addData(DataBoxPb.Builder builderForValue) {
            if (dataBuilder_ == null) {
                ensureDataIsMutable();
                data_.add(builderForValue.build());
                onChanged();
            } else {
                dataBuilder_.addMessage(builderForValue.build());
            }
            return this;
        }

        /**
         * <code>repeated .DataBoxPb data = 1;</code>
         */
        public Builder addData(int index, DataBoxPb.Builder builderForValue) {
            if (dataBuilder_ == null) {
                ensureDataIsMutable();
                data_.add(index, builderForValue.build());
                onChanged();
            } else {
                dataBuilder_.addMessage(index, builderForValue.build());
            }
            return this;
        }

        /**
         * <code>repeated .DataBoxPb data = 1;</code>
         */
        public Builder addAllData(java.lang.Iterable<? extends DataBoxPb> values) {
            if (dataBuilder_ == null) {
                ensureDataIsMutable();
                com.google.protobuf.AbstractMessageLite.Builder.addAll(values, data_);
                onChanged();
            } else {
                dataBuilder_.addAllMessages(values);
            }
            return this;
        }

        /**
         * <code>repeated .DataBoxPb data = 1;</code>
         */
        public Builder clearData() {
            if (dataBuilder_ == null) {
                data_ = java.util.Collections.emptyList();
                bitField0_ = (bitField0_ & ~0x00000001);
                onChanged();
            } else {
                dataBuilder_.clear();
            }
            return this;
        }

        /**
         * <code>repeated .DataBoxPb data = 1;</code>
         */
        public Builder removeData(int index) {
            if (dataBuilder_ == null) {
                ensureDataIsMutable();
                data_.remove(index);
                onChanged();
            } else {
                dataBuilder_.remove(index);
            }
            return this;
        }

        /**
         * <code>repeated .DataBoxPb data = 1;</code>
         */
        public DataBoxPb.Builder getDataBuilder(int index) {
            return getDataFieldBuilder().getBuilder(index);
        }

        /**
         * <code>repeated .DataBoxPb data = 1;</code>
         */
        public DataBoxPbOrBuilder getDataOrBuilder(int index) {
            if (dataBuilder_ == null) {
                return data_.get(index);
            } else {
                return dataBuilder_.getMessageOrBuilder(index);
            }
        }

        /**
         * <code>repeated .DataBoxPb data = 1;</code>
         */
        public java.util.List<? extends DataBoxPbOrBuilder> getDataOrBuilderList() {
            if (dataBuilder_ != null) {
                return dataBuilder_.getMessageOrBuilderList();
            } else {
                return java.util.Collections.unmodifiableList(data_);
            }
        }

        /**
         * <code>repeated .DataBoxPb data = 1;</code>
         */
        public DataBoxPb.Builder addDataBuilder() {
            return getDataFieldBuilder().addBuilder(DataBoxPb.getDefaultInstance());
        }

        /**
         * <code>repeated .DataBoxPb data = 1;</code>
         */
        public DataBoxPb.Builder addDataBuilder(int index) {
            return getDataFieldBuilder().addBuilder(index, DataBoxPb.getDefaultInstance());
        }

        /**
         * <code>repeated .DataBoxPb data = 1;</code>
         */
        public java.util.List<DataBoxPb.Builder> getDataBuilderList() {
            return getDataFieldBuilder().getBuilderList();
        }

        private com.google.protobuf.RepeatedFieldBuilderV3<DataBoxPb, DataBoxPb.Builder, DataBoxPbOrBuilder> getDataFieldBuilder() {
            if (dataBuilder_ == null) {
                dataBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<DataBoxPb, DataBoxPb.Builder, DataBoxPbOrBuilder>(data_, ((bitField0_ & 0x00000001) == 0x00000001), getParentForChildren(), isClean());
                data_ = null;
            }
            return dataBuilder_;
        }

        public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
            return super.setUnknownFieldsProto3(unknownFields);
        }

        public final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
            return super.mergeUnknownFields(unknownFields);
        }

        // @@protoc_insertion_point(builder_scope:DataBoxesPb)
    }
}
